mui.init();
mui('.mui-scroll-wrapper').scroll({
	scrollY: false, //是否竖向滚动
 	scrollX: true, //是否横向滚动
});
document.addEventListener("plusready", function() {
	var wv = plus.webview.currentWebview();
	var txt = wv.responseText;
	var re = txt.match(/\[([\d.e-]+), ([\d.e-]+)/);
	document.getElementById('possible').innerHTML = fmtNum(re[1]);
	document.getElementById('impossible').innerHTML = fmtNum(re[2]);
	var imgUrl = localStorage.getItem('imgUrl');
	mui('.user-img')[0].src = imgUrl;
}, false);

function fmtNum(str){
	var s = str + '';
	var n = Number(s);
	return Math.round(n * 1000000)/10000 + '%';
}

var previewBox = mui('.preview-img')[0];
var previewImg = mui('.preview-img img')[0];
var mask = null;
mui('.mui-content').on('tap', 'img', function(){
	previewImg.src = this.src;
	previewBox.style.display = 'block';
	if(!mask){
		mask = mui.createMask(function(){
			previewBox.style.display = 'none';
			return true;
		})
	}
	mask.show();
})
